package com.jack.lib.net

import com.blankj.utilcode.util.NetworkUtils
import com.jack.lib.core.utils.JLog

/**
 * author : chong.huang
* create : 2/14/21
 * desc   :
 */
class NetworkStatusObserver(private val block: (NetworkUtils.NetworkType) -> Unit) : NetworkUtils.OnNetworkStatusChangedListener {

    override fun onConnected(networkType: NetworkUtils.NetworkType) {
        JLog.i("jhttp", "NetworkType: " + networkType.name)
        block(networkType)
    }

    override fun onDisconnected() {
    }
}